import { lazy } from "react";

const Home = lazy(() => import("../pages/Home/Index"));
const Login = lazy(() => import("../pages/Login/Index"));
const List = lazy(() => import("../pages/List/Index"));
const Message = lazy(() => import("../pages/Message/Index"));
const Addproson = lazy(() => import("../pages/Addproson/Index"));
const User = lazy(() => import("../pages/User/Index"));
const MainLoaty = lazy(() => import("../pages/MainLoaty/Index"));
const Detail = lazy(() => import("../pages/Detail/Index"));
const Erron = lazy(() => import("../pages/404/Index"));
export const RouterList = [
  {
    path: "/",
    element: <Home />,
    title: "首页",
  },
  {
    path: "/message",
    element: <Message />,
    title: "消息",
  },
  {
    path: "/user",
    element: <User />,
    title: "个人中心",
  },
];
export const Router = [
  {
    path: "/",
    element: <MainLoaty />,
    children: RouterList,
  },
  {
    path: "/login",
    element: <Login />,
  },
  {
    path: "/list",
    element: <List />,
  },
  {
    path: "/addproson",
    element: <Addproson />,
  },
  {
    path: "/detail/:id",
    element: <Detail />,
  },
  {
    path: "/*",
    element: <Erron />,
  },
];
